Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up two more jobs to handle staging and production cases for automerge workflow #1802

Merged
merged 8 commits into from
Mar 16, 2021

Conversation

AndrewGable
Copy link
Contributor

Details

This PR does two things:

  1. Adds logic for auto merge PRs via the following logic:
  • Never automerge for anyone except OSBotify
  • If the PR target is master, only merge if only those specific files are changed, and none are added or deleted
  • If the PR target is staging, only merge if the PR head branch is master
  • If the PR target is production, only merge if the PR head branch is staging
  1. Skips all PR checks for auto merge PRs as we merge without waiting for those anyways

Fixed Issues

Fixes deploys from not running

Tests

Merge this PR and verify that a staging PR is created and merged automatically

@AndrewGable AndrewGable self-assigned this Mar 16, 2021
@AndrewGable AndrewGable requested a review from a team as a code owner March 16, 2021 21:23
@botify botify requested review from deetergp and removed request for a team March 16, 2021 21:23
@AndrewGable
Copy link
Contributor Author

Don't merge, looks like my logic for branches-ignore is wrong.

@AndrewGable AndrewGable changed the title Set up two more jobs to handle staging and production cases for automerge workflow [hold] Set up two more jobs to handle staging and production cases for automerge workflow Mar 16, 2021
@AndrewGable AndrewGable changed the title [hold] Set up two more jobs to handle staging and production cases for automerge workflow Set up two more jobs to handle staging and production cases for automerge workflow Mar 16, 2021
@AndrewGable
Copy link
Contributor Author

Ok ready for review

Copy link
Contributor

@roryabraham roryabraham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few syntax changes

if: |
${{ needs.chooseDeployActions.outputs.isStagingDeployLocked == 'true' }} &&
${{ needs.chooseDeployActions.outputs.isVersionBumpPR == 'false' }}
if: ${{ needs.chooseDeployActions.outputs.isStagingDeployLocked == 'true' }} && ${{ needs.chooseDeployActions.outputs.isVersionBumpPR == 'false' }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need this to be like this:

Suggested change
if: ${{ needs.chooseDeployActions.outputs.isStagingDeployLocked == 'true' }} && ${{ needs.chooseDeployActions.outputs.isVersionBumpPR == 'false' }}
if: ${{ needs.chooseDeployActions.outputs.isStagingDeployLocked == 'true' && needs.chooseDeployActions.outputs.isVersionBumpPR == 'false' }}

if: |
${{ needs.chooseDeployActions.outputs.isVersionBumpPR == 'true' }} &&
${{ needs.chooseDeployActions.outputs.isStagingDeployLocked == 'false' }}
if: ${{ needs.chooseDeployActions.outputs.isVersionBumpPR == 'true' }} && ${{ needs.chooseDeployActions.outputs.isStagingDeployLocked == 'false' }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if: ${{ needs.chooseDeployActions.outputs.isVersionBumpPR == 'true' }} && ${{ needs.chooseDeployActions.outputs.isStagingDeployLocked == 'false' }}
if: ${{ needs.chooseDeployActions.outputs.isVersionBumpPR == 'true' && needs.chooseDeployActions.outputs.isStagingDeployLocked == 'false' }}

@@ -153,6 +149,10 @@ jobs:
- name: Checkout master branch
run: git checkout master

- name: Set Staging Version
run: |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NAB no need for the | here AFAIK

Copy link
Contributor

@roryabraham roryabraham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, LGTM

@roryabraham roryabraham merged commit eeaf5c7 into master Mar 16, 2021
@roryabraham roryabraham deleted the andrew-auto-merge-staging branch March 16, 2021 22:17
@botify
Copy link

botify commented Mar 16, 2021

@roryabraham looks like this was merged without passing tests. Please add a note explaining why this was done or remove the Emergency label if this is not an emergency.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 16, 2021
@roryabraham
Copy link
Contributor

Merging to un-break deploys

@roryabraham
Copy link
Contributor

I believe this PR causes duplicate CLA actions to run on pull requests:

image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants